import { instance as request } from "@/utils/request"
type RETURNDATA = {
  code: number
  msg: string
  data?: any
}
const getUsersList = (url: string, params?: any) => {
  return request<any, RETURNDATA>({
    method: "GET",
    url,
    params: params,
  })
}
const addUser = (url: string, data?: any) => {
  return request<any, RETURNDATA>({
    method: "POST",
    url,
    data: data,
  })
}
const delUsers = (url: string, params?: any) => {
  return request<any, RETURNDATA>({
    method: "DELETE",
    url,
    params: params,
  })
}
const putUsers = (url: string, data?: any, params?: any) => {
  return request<any, RETURNDATA>({
    method: "PUT",
    url,
    data: data,
    params: params,
  })
}
const getUserInfo = (url: string, params?: any) => {
  return request<any, RETURNDATA>({
    method: "GET",
    url,
    params: params,
  })
}

export { getUsersList, delUsers, addUser, putUsers, getUserInfo }
